﻿



-- 离职审批记录
CREATE proc [dbo].[proc_Employee_Dimission_GetAuditRecord]
(
	@id int
)
as
	select 
		EE.Id,
		(select Enumber from Employee E where EE.EId=E.Id) as Enumber,
		(select ETempNumber from Employee E where EE.EId=E.Id) as ETempNumber,
		EE.EId,
		(select EName from Employee E where EE.EId=E.Id) as EName,
		(select CompanyName from Company where id=(select companyid from employee E where EE.EId=E.Id)) as CompanyName,
		(select DName from Department where id=(select departmentid from employee E where EE.EId=E.Id)) as DName,
		(select PostName from Post P where id=(select PostId from employee E where EE.EId=E.Id)) as PostName,
		Proposer,
		(SELECT E.EName FROM Employee E WHERE E.UserName=ee.proposer) as ProposerName,
		ee.appliontime,
		ee.reason,
		EE.Audit,
		EE. AuditPerson,
		(select EName from Employee E where EE.AuditPerson=E.UserName) as AuditPersonName,
		EE.AuditTime,
		EE.Memo,
		EE.DTemp,EE.LizhiDate
	from employee_Dimission EE
	where id = @id



